# tasks/urls.py
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import TaskViewSet

router = DefaultRouter()
router.register(r'tasks', TaskViewSet, basename='task')  # 确保任务视图集注册时没有遗漏

urlpatterns = [
    path('', include(router.urls)),  # 包含 router.urls 会自动处理 /tasks/ 和 /tasks/{id}/
]
